﻿using Furion.EventBus;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Furion.Application
{
    public class EventFallbackPolicy : IEventFallbackPolicy
    {
        private readonly ILogger<EventFallbackPolicy> _logger;
        public EventFallbackPolicy(ILogger<EventFallbackPolicy> logger)
        {
            _logger = logger;
        }

        public async Task CallbackAsync(EventHandlerExecutingContext context, Exception ex)
        {
            _logger.LogError(ex, "重试了多次最终还是失败了");
            await Task.CompletedTask;
        }
    }
}
